<!DOCTYPE html>



<html>



<head>



    <title>add</title>



	<include file='public/head'>



	



	<style>



		.layui-legend-size{font-size:14px !important;}



		.layui-nopadding{padding:0 !important;}



		.layui-overflow{overflow:auto;}



		.layui-nomargin{margin: 0 !important;}



		.layui-bottom{border-bottom:1px solid rgb(226, 226, 226);}



		.layui-input{height:30px !important; }



		.layui-form-search-item .layui-inline{margin-bottom: 5px;} 



		.layui-form-search-item label{margin-left: 15px;}



		.layui-table-page {padding: 7px 0px 0px;}



		.layui-field-padding{border-width: 1px;padding:0 0 5px 10px;}



	</style>



</head>



<body>







<div class="layui-fluid">



	<form class="layui-form" id="f">



		{$addStr}



	</form>



</div>



<include file='public/scripts'>







<script type="text/javascript">



	



	var tijiao = function(){







		if($("input[name='login_name']").val() == ''){



			layer.msg('请输入登录名');



			return false;



		}



		if($("input[name='password']").val() == ''){

			layer.msg('请输入密码');

			return false;

		}







		if($("input[name='nick_name']").val() == ''){



			layer.msg('请输入昵称');



			return false;



		}



		if($("input[name='repassword']").val() == ''){

			layer.msg('请再次输入密码');

			return false;

		}



		if($("input[name='password']").val() != $("input[name='repassword']").val()){

			layer.msg('两次的密码不相同');

			return false;

		}







		if($("input[name='phone']").val() == ''){



			layer.msg('请输入手机');



			return false;



		}







		if($("input[name='head_portrait']").val() == ''){



			layer.msg('请上传头像');



			return false;



		}







		//检验手机号



		let regs = /^((13[0-9])|(17[0-1,6-8])|(15[^4,\\D])|(18[0-9]))\d{8}$/;



		let phone = $("input[name='phone']").val();



		if(!regs.test(phone)){



			layer.msg('手机号输入不正确');



			return false;



		}









		//提交

		$.ajax({
			url:"{:cmf_plugin_url('Member://admin_index/addPage')}",
			data: $('#f').serialize(),
			type:'post',
			success:function(data){
				if (data.code == 1) {
					layer.msg(data.msg,{icon:1,time:1500},function(){
						parent.layer.closeAll();
						parent.location.reload(); 
					});
				} else {
					layer.msg(data.msg,{icon:2,time:1500});
				}
			},

			error:function()
			{
				layer.msg('系统错误',{icon:2,time:1500});
			}



		})



	}







</script>







</body>



</html>